package socrates.mobile;

import java.util.List;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.TextView;

public class TextAdapter extends BaseAdapter{
	private Context mContext;  
	private List cadena;
	
	public TextAdapter(Context c, List ls) 
	{        
		mContext = c;   
		cadena = ls;
	}    
	
	public int getCount() 
	{        
		return cadena.size();    
	}    
	
	public Object getItem(int position) 
	{        
		return null;    
	}    
	
	public long getItemId(int position) 
	{        
		return 0;    
	}    
	
	// create a new ImageView for each item referenced by the Adapter    
	public View getView(int position, View convertView, ViewGroup parent) 
	{        
		TextView tv;        
		if (convertView == null) 
		{  // if it's not recycled, initialize some attributes            
			tv = new TextView(mContext);            
			tv.setLayoutParams(new GridView.LayoutParams(85, 85));           
			tv.setPadding(8, 8, 8, 8);        
		} 
		else 
		{            
			tv = (TextView) convertView;        
		}        
		tv.setText(cadena.get(position).toString());        
		return tv;    
	}    
	
}
